package com.kinyx.demo.entities.impl;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(indexes = {
		@Index(columnList = "IDX_120"), //
		@Index(columnList = "idx_131,idx_132"), //
		@Index(name = "idxa", columnList = "idx_140"), //
		@Index(name = "idxb", columnList = "idx_151,idx_152"), //

		@Index(columnList = "idx_220", unique = true), //
		@Index(columnList = "idx_231,idx_232", unique = true), //
		@Index(name = "idxc", columnList = "idx_240", unique = true), //
		@Index(name = "idxd", columnList = "idx_251,idx_252", unique = true), //

		//		@Index(columnList = "idx_300 DESC", unique = true), //
		@Index(columnList = "idx_311 DESC, idx_312 DESC"), //
})
public class IndexesEntity {

	@Id
	@Column(nullable = false, updatable = false, length = 32)
	private String c00;

	// @Table(indexes)单独分组，未设置名称。
	private Integer idx_120;

	// @Table(indexes)组合分组，未设置名称。
	private Integer idx_131;
	private Integer idx_132;

	// @Table(indexes)单独分组，设置名称。
	private Integer idx_140;

	// @Table(indexes)组合分组，设置名称。
	private Integer idx_151;
	private Integer idx_152;

	// ========================= unique ========================= //
	// @Table(indexes)单独分组，未设置名称。
	private Integer idx_220;

	// @Table(indexes)组合分组，未设置名称。
	private Integer idx_231;
	private Integer idx_232;

	// @Table(indexes)单独分组，设置名称。
	private Integer idx_240;

	// @Table(indexes)组合分组，设置名称。
	private Integer idx_251;
	private Integer idx_252;

	// ========================= order ========================= //
	private Integer idx_300;

	private Integer idx_311;
	private Integer idx_312;

}
